package com.loong.seller.common.backend.param;

import com.loong.common.validator.group.CommonInsert;
import com.loong.common.validator.group.CommonUpdate;
import lombok.*;

import javax.persistence.Column;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * @Description:
 * @Author: hzp
 * @Date: 2020-12-16 14:15
 */
@Builder
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class ShopDeliveryRuleParam {

    @NotNull(groups = {CommonUpdate.class},message = "id不能为空")
    private Long id;
    /**
     * 店铺id
     */
    @NotNull(groups = {CommonInsert.class},message = "新增时店铺id不能为空")
    private Long shopId;

    /**
     * 店铺配送规则名称
     */
    @NotBlank(groups = {CommonInsert.class},message = "新增时配送规则名称")
    private String ruleName;

    /**
     * 店铺配送规则命中范围 时间是（17:05:00-19:05:00） 距离是（1000-3000）单位是米
     */
    @NotBlank(groups = {CommonInsert.class},message = "新增时店铺配送规则命中范围")
    private String ruleRange;

    /**
     * 店铺配送规则执行动作（加减乘除 + - * /）
     *  ADD("add","加"),SUBTRACT("subtract","减"),MULTIPLY("multiply","乘"),DIVIDE("divide","除以");
     *  传参是 add subtract ...
     */
    @NotBlank(groups = {CommonInsert.class},message = "新增时店铺配送规则执行动作")
    private String ruleAction;

    /**
     * 店铺配送规则操作的值
     */

    private BigDecimal ruleValue;

    /**
     * 店铺配送规则类型 （区分维度 时间和距离）
     * 1-->时间
     * 2-->距离
     */

    private Integer ruleType;
}
